package com.example.delicioushunter.control.supportcontrol;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class DHSharedPreference {
	SharedPreferences pref;
	Editor editor;
	Context _context;

	int PRIVATE_MODE = 0;
	private static final String PREF_NAME = "User_Settings";
	private static final String IS_LOGIN = "IsLogin";
	private static final String IS_SIGNATURE = "isSignature";
	private static final String WIDTH = "width";
	private static final String HEIGHT = "height";
	private static final String BOOK_WIDTH = "book_width";
	private static final String BOOK_HEIGHT = "book_height";
	private static final String FOOD_WIDTH = "food_width";
	private static final String FOOD_HEIGHT = "food_height";
	private static final String ISSPENFEATUREENABLED = "isSpenFeatureEnabled";

	public DHSharedPreference(Context context) {
		this._context = context;
		pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
		editor = pref.edit();
	}

	public void setSignature(boolean isSignature) {
		editor.putBoolean(IS_SIGNATURE, isSignature);
		editor.commit();
	}

	public boolean getSignature() {
		return pref.getBoolean(IS_SIGNATURE, false);
	}

	public void setLogin(boolean isLogin) {
		editor.putBoolean(IS_LOGIN, isLogin);
		editor.commit();
	}

	public boolean getLogin() {
		return pref.getBoolean(IS_LOGIN, false);
	}

	public void setWidth(int width) {
		editor.putInt(WIDTH, width);
		editor.commit();
	}

	public int getWidth() {
		return pref.getInt(WIDTH, 0);
	}

	public void setHeight(int height) {
		editor.putInt(HEIGHT, height);
		editor.commit();
	}

	public int getHeight() {
		return pref.getInt(HEIGHT, 0);
	}

	public void setBookWidth(int book_width) {
		editor.putInt(BOOK_WIDTH, book_width);
		editor.commit();
	}

	public int getBookWidth() {
		return pref.getInt(BOOK_WIDTH, 0);
	}

	public void setBookHeight(int book_height) {
		editor.putInt(BOOK_HEIGHT, book_height);
		editor.commit();
	}

	public int getBookHeight() {
		return pref.getInt(BOOK_HEIGHT, 0);
	}

	public void setFoodWidth(int food_width) {
		editor.putInt(FOOD_WIDTH, food_width);
		editor.commit();
	}

	public int getFoodWidth() {
		return pref.getInt(FOOD_WIDTH, 0);
	}

	public void setFoodHeight(int food_height) {
		editor.putInt(FOOD_HEIGHT, food_height);
		editor.commit();
	}

	public int getFoodHeight() {
		return pref.getInt(FOOD_HEIGHT, 0);
	}

	public void setIsSpenFeatureEnabled(boolean isSpenFeatureEnabled) {
		editor.putBoolean(ISSPENFEATUREENABLED, isSpenFeatureEnabled);
		editor.commit();
	}

	public boolean getIsSpenFeatureEnabled() {
		return pref.getBoolean(ISSPENFEATUREENABLED, false);
	}
}
